package net.sx.minemodule.mvp.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.kedll.library.adapter.MultiTypeAdapter;
import com.kedll.library.mvp.BaseModel;

import net.sx.minemodule.mvp.item.TestIntegralItem;

/**
 * @author 邵帅
 */
public class TestIntegralBean extends BaseModel<TestIntegralItem> implements Parcelable {

    private int integralNum;
    private int money;
    private boolean isSelect;

    @Override
    public TestIntegralItem createItem(MultiTypeAdapter adapter) {
        return new TestIntegralItem(this);
    }

    public int getIntegralNum() {
        return integralNum;
    }

    public void setIntegralNum(int integralNum) {
        this.integralNum = integralNum;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.integralNum);
        dest.writeInt(this.money);
        dest.writeByte(this.isSelect ? (byte) 1 : (byte) 0);
    }

    public TestIntegralBean() {
    }

    protected TestIntegralBean(Parcel in) {
        this.integralNum = in.readInt();
        this.money = in.readInt();
        this.isSelect = in.readByte() != 0;
    }

    public static final Creator<TestIntegralBean> CREATOR = new Creator<TestIntegralBean>() {
        @Override
        public TestIntegralBean createFromParcel(Parcel source) {
            return new TestIntegralBean(source);
        }

        @Override
        public TestIntegralBean[] newArray(int size) {
            return new TestIntegralBean[size];
        }
    };
}
